package two.dimensional.arrays;

/**
 * @author shkstart
 * @date 2022/4/17 - 18:33
 */
//      求平均值，最小值，最大值，总和
public class ArrayTest01 {
    public static void main(String[] args) {
        int arr[] = new int[10];
        for (int i = 0; i < arr.length; i++ ) {
            arr[i] = (int)(Math.random()*90 + 10);
            System.out.println(arr[i]);
        }
        int maxValue = arr[0];
        int sum = 0;
        for (int i = 1; i < arr.length; i++ ) {
            if ( maxValue < arr[i] ) {
                maxValue = arr[i];
                 sum += arr[i];
            }
        }
        System.out.println(maxValue);

        int minValue = arr[0];
        for (int i = 1; i < arr.length; i++ ) {
            if ( minValue > arr[i] ) {
                minValue = arr[i];
            }
        }
        System.out.println(minValue);
        System.out.println(sum);

        double pingJun = sum / arr.length;
        System.out.println(pingJun);

    }
}
